//
//  TYHomeFunctionFlowLayout.m
//  爱鲜蜂
//
//  Created by 李田 on 16/11/8.
//  Copyright © 2016年 tianyao. All rights reserved.
//

#import "LBHomeFunctionFlowLayout.h"

@implementation LBHomeFunctionFlowLayout


#pragma mark - 设置flowLayout
- (void)prepareLayout{
    
    [super prepareLayout];
    //    MARK: 设置行 控件之间最小间距
    self.minimumLineSpacing = 1 / [UIScreen mainScreen].scale;
    self.minimumInteritemSpacing = 1 / [UIScreen mainScreen].scale;
    
    //    MARK: item的大小
    CGFloat width = (self.collectionView.bounds.size.width - 3) / 4;
    CGFloat height = width;
    
    self.itemSize = CGSizeMake(width, height);
    
    //    MARK: 设置组与组之间的间距
    self.sectionInset = UIEdgeInsetsMake(0, 0, 10, 0);
    
}



//- (NSArray<UICollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(CGRect)rect{
//
//    NSArray *array = [super layoutAttributesForElementsInRect:rect];
//    
//    for (UICollectionViewLayoutAttributes *attr in array) {
//        
//        if (attr.indexPath.section == 0) {
//            
//            CGRect frame = attr.frame;
//            
//            frame.size.width = self.collectionView.frame.size.width;
//            
//            frame.size.height = 240;
//            
//            attr.frame = frame;
//        }
//        
//    }
//    
//    return array;
//}


@end




